<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="include.jsp" %>
<!DOCTYPE html>
<html lang="en">
<head>
<%@ include file="head.jsp" %>
<title><spring:message code="title.gallery" /></title>
</head>
 
<body>
	<%@ include file="header.jsp" %>
	<div class="container-fluid">
		<div class="row-fluid">
			<%@ include file="menu.jsp" %>
			<div class="span10">
				<%@ include file="breadcrumb.jsp" %>	
				<a href="${pageContext.request.contextPath }/gallery/addForm.htm" class="pull-right btn btn-success">Add Gallery</a>
				<div class="page-header">
					<h2>Manage Gallery</h2>		
				</div>
				<div class="tabbable">
					<ul class="nav nav-tabs">
						<li class="active"><a data-toggle="tab" href="#tab1">Gallery List</a></li>
						<li class=""><a data-toggle="tab" href="#tab2">Search</a></li>
					</ul>
					<div class="tab-content">
						<div id="tab1" class="tab-pane active">
							<div class="pagination vnaloha-pagination">
								<a class="btn reload popup-tooltip" href="#" rel="popover" data-original-title="<spring:message code="popup.information" />" 
									data-content="<spring:message code="popup.deleteManyRecord" />"
									onclick="dashboard.admin.action.deleteAll('gallery')">
									<i class="icon-trash"></i>&nbsp;&nbsp;<spring:message code="button.delete" /> 
								</a>
								<a class="btn reload popup-tooltip" href="#" rel="popover" data-original-title="<spring:message code="popup.information" />" 
									data-content="<spring:message code="popup.reload" />"
									onclick="javascript:location.reload()">
									<i class="icon-refresh"></i>&nbsp;&nbsp;<spring:message code="button.reload" />
								</a>
								<ul class="pull-right">
									<li><a href="" title="First Page">&laquo;&laquo;</a></li>
									<li><a href="" title="Previos Page">&laquo;</a></li>
									<li><a href="" title="Next Page">&raquo;</a></li>
									<li><a href="" title="Last Page">&raquo;&raquo;</a></li>
								</ul>
							</div>
							<table class="table table-bordered">
								<thead>
									<tr>
										<th width="10">
											<input type="checkbox" class="popup-tooltip" value="" id="checkall_deleteid"
												rel="popover" data-original-title="<spring:message code="popup.information" />" 
												data-content="<spring:message code="popup.message.selectAll" />">
										</th>
										<th width="130">&nbsp;</th>
										<th><spring:message code="label.title" /></th>
										<th><spring:message code="label.description" /></th>
										<th>Path</th>
										<th width="50">Enable</th>
										<th width="130">&nbsp;</th>
									</tr>
								</thead>
								<c:if test="${!empty galleries}">
								<tbody>
									<c:forEach items="${galleries}" var="gallery">
									<tr>
										<td>
											<input type="checkbox" name="delete_id" value="${gallery.id }" id="id">
										<td>
											<a class="thumbnail" href="#">
												<img class="lazy" width="130" alt="${gallery.title }" src="${pageContext.request.contextPath }${gallery.filePath }">
											</a>											
										</td>
										<td>${gallery.title }</td>
										<td>${gallery.description }</td>
										<td><a target="_blank" href="${pageContext.request.contextPath }${gallery.filePath }">${pageContext.request.contextPath }${gallery.filePath }</a></td>
										<td>
											<c:choose>
												<c:when test="${gallery.enable == 1 }">
													<span class="label label-success">YES</span>
												</c:when>
												<c:otherwise>
													<span class="label label-important">NO</span>
												</c:otherwise>
											</c:choose>
										</td>
										<td>
											<a class="btn btn-mini" href="${pageContext.request.contextPath}/gallery/edit/${gallery.id}">
												<i class="icon-edit"></i> <spring:message code="button.edit" />
											</a>
											<a class="btn btn-mini btn-danger" href="${pageContext.request.contextPath}/gallery/delete/${gallery.id}"
												onclick="return confirm('Are you sure you want to delete this file?')"><i class="icon-remove icon-white"></i> <spring:message code="button.delete" /></a>
										</td>
									</tr>
									</c:forEach>
								</tbody>
								</c:if>
							</table>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<%@ include file="footer.jsp" %>
</body>
</html>